package com.darkness.rpc.test.consumer;

import com.darkness.api.TestItf;
import com.darkness.rpc.framework.consumer.RpcConsumer;

/**
 * @author darkness
 * @time 2022/4/15 9:22
 * @description
 */
public class ConsumerMain {

    public static void main(String[] args) {
        String registry = "file";
        RpcConsumer<TestItf> httpConsumer1 = new RpcConsumer<>("httpGroup", TestItf.class, "1.0.1", "http");
        TestItf httpItf1 = httpConsumer1.getConsumer(registry);
        RpcConsumer<TestItf> httpConsumer2 = new RpcConsumer<>("httpGroup", TestItf.class, "1.0.2", "http");
        TestItf httpItf2 = httpConsumer2.getConsumer(registry);
        RpcConsumer<TestItf> darkConsumer1 = new RpcConsumer<>("darkGroup", TestItf.class, "1.0.1", "dark");
        TestItf darkItf1 = darkConsumer1.getConsumer(registry);
        RpcConsumer<TestItf> darkConsumer2 = new RpcConsumer<>("darkGroup", TestItf.class, "1.0.2", "dark");
        TestItf darkItf2 = darkConsumer2.getConsumer(registry);
        System.out.println(httpItf1.sayHello("http"));
        System.out.println(httpItf2.sayHello("http"));
        System.out.println(darkItf1.sayHello("dark"));
        System.out.println(darkItf2.sayHello("dark"));

    }

}
